<!DOCTYPE html>
<html>
<head>
<title>用户基本信息管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<#include "../../../../include/resources.html">

<script type="text/javascript">
	var dataGrid;
	var winWidth =  500;
	var winHeight = 300;
	var editTitle = "锁定用户";
	var editUrl =  "/modules/user/user/user/userLockEditPage.html";
	var editWinParmeters = "'{0}','"+editTitle+"',"+winWidth+","+winHeight+",'"+editUrl+"','确定'";
	var editTitle = "修改用户信息";
	var userReadUrl =  "/modules/user/user/user/userEditPage.html";
	var userReadParmeters = "'{0}','"+editTitle+"',"+winWidth+","+winHeight+",'"+userReadUrl+"','确定'";
	
	var txt1 = "锁定";
	var txt2 = "解锁";
	var val1 = true;
	var val2 = false;
	
	$(function() {
		dataGrid = $('#dataGrid').datagrid({
			url : 'userList.html',
			fit : true,
			fitColumns : true,
			border : false,
			pagination : true,
			idField : 'userId',
			pageSize : pageSize,
			pageNums :1,
			pageList : pageList,
			sortName : 'userId',
			sortOrder : 'asc',
			checkOnSelect : false,
			selectOnCheck : false,
			autoRowHeight : true,
			nowrap : false,
			singleSelect:true,
			columns : [ [
				{ field: 'userId', title: '编号', width: 60, fixed :true,checkbox : false},
				{ field: 'userName', title: '用户名', width: 80, fixed :true,checkbox : false},
				{ field: 'realName', title: '真实姓名', width: 100, sortable: false },
//				{ field: 'sex', title: '性别', width: 45, fixed :true,sortable: false ,
//					formatter: function(value,row,index){
//						if(value == 0){
//							return "女";
//						}else if(value == 1){
//							return "男";
//						}
//						return "";
//					}
//				},
				{ field: 'email', title: '邮箱', width: 140, sortable: false },
				{ field: 'mobilePhone', title: '手机号码',fixed :true, width: 120, sortable: false },
				{ field: 'cardId', title: '身份证号码',fixed :true, width: 150, sortable: false },
				{ field: 'realNameStatus', title: '实名状态', width: 70, sortable:false, 
					formatter: function(value,row,index){
						if(value == 0){
							return "未认证";
						}else if(value == 1){
							return "认证通过";
						}else if(value == 2){
							return "待审核";
						}else if(value == -1){
							return "认证未通过";
						}
						return "";
					}
				},
				{ field: 'status', title: '锁定状态', width: 70, sortable:false,formatter: function(value,row,index){
						if(value==0){
							return "未锁定";
						}else if(value == 1){
							return "锁定";
						}
						return "";
					}
				}, 
	            { field: 'addTime', title: '注册时间', width: 150, fixed:true,sortable:false, 
	          	  	formatter: function(value,row,index){
	          	  		return getLocalTime(value,4);
					  	}  
	            },
				{field : 'action',title : '操作',width :60,fixed :true,
					formatter : function(value, row, index) {
						var str = '';
						if (row) {
							str += '<a href="javascript:void(0);" onclick="$.fn.dataGridOptions.editFun('+row.userId+',editTitle,winWidth,winHeight,editUrl);" title="锁定用户">锁定</a>' ;
						}
						str += '&nbsp;';
						
						return str;
					}
				}
			] ]
		});
	});
	function exportExcel(){
		var url = "/modules/user/user/user/doExportExcel.html";
		var userName = $("#userName").val();
		var realName = $("#realName").val();
		var mobilePhone = $("#mobilePhone").val();
		var realNameStatus = $("#realNameStatus").val();
		var status = $("#status").val();
		var startTime = $("#startTime").val();
		var endTime = $("#endTime").val();
		var sou = "?userName=" + userName + "&realName=" + realName + "&mobilePhone=" + mobilePhone+ "&userIdentify.realNameStatus=" + realNameStatus +
				"&status=" + status+ "&startTime=" + startTime + "&endTime=" + endTime;
		window.location.href = url + sou;
	}
</script>
</head>
<body style="padding:0 20px;" >
	<div class="easyui-layout" data-options="fit : true,border : false">
		<div data-options="region:'north',border:false,collapsible:false" id="searchBox">
        	<div class="sLeft">
	            <form id="searchForm">
	            	<input type="text"  name="searchName" class="sInput" placeholder="输入用户名/真实姓名进行搜索" autocomplete="off" onkeydown="if(event.keyCode == 13){ $.fn.dataGridOptions.searchFun('#searchForm');return false;}"/><a href="javascript:;" title="查询" class="sBtn" onclick="$.fn.dataGridOptions.searchFun('#searchForm');">查询</a><a href="javascript:;" class="advBtn" title="条件查询">条件查询 <i class="iconfont">&#xe638;</i></a>
	            	 <a href="javascript:void(0);" class="reloadIcon" onclick="dataGrid.datagrid('reload');" title="刷新" ><i class="iconfont">&#xe603;</i></a>
	            </form>
            </div>
			<form id="showAdw">
				<ul class="showAdw" style="display:none;">
					<a href="javascript:void(0);"><i class="iconfont closeWin">&#xe63a;</i></a>
					<li><span>用户名</span><input type="text" name="userName" id="userName" autocomplete="off"/></li>
					<li><span>真实姓名</span><input type="text" name="realName" id="realName" autocomplete="off"/></li>
					<li><span>手机号码</span><input type="text" name="mobilePhone" id="mobilePhone" autocomplete="off"/></li>
					<li><span>实名状态</span><select name="userIdentify.realNameStatus" id="realNameStatus" class="type">
						<option value=-2>全部</option>
						<option value="0">未认证</option>
						<option value="1">认证通过</option>
						<option value="2">待审核</option>
						<option value="-1">认证未通过</option>
					</select></li>
					<li><span>状态</span><select name="status" id="status" class="type">
						<option value="99" selected="selected">全部</option>
						<option value="0">未锁定</option>
						<option value="1">锁定</option>
					</select></li>
					<li><span>注册时间</span><input type="text" name="startTime" id="startTime" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')}',readOnly:true})" class="searchTime"/>&nbsp;-&nbsp;<input type="text" name="endTime" id="endTime" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startTime\')}',readOnly:true})" class="searchTime"/></li>
					<li><span></span><a href="javascript:void(0);" class="searchBtn sureBtn" onclick="$.fn.dataGridOptions.searchFun('#showAdw');">确定</a><a href="javascript:void(0);" class="searchBtn" onclick="$.fn.dataGridOptions.cleanFun('#searchForm');">重置</a></li>
				</ul>
			</form>
			<div class="sRight">
				<a onclick="exportExcel();" href="javascript:void(0);" class="addBtn">导出excel</a>
			</div>
		</div>
		<div data-options="region:'center'" style="margin-top:30px;padding-bottom:30px;">
			<table id="dataGrid"></table>
		</div>
	</div>
</body>
</html>
<script src="${theme_dir}/js/search.js"></script>